home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / qb2 / pro13 / demo.src < prev    next >
Encoding:
Text File  |  1988-05-10  |  14.5 KB  |  358 lines

  1. ' +---------------------------------------------------------------------------+
  2. ' | Program........: PDEMO.SRC                                                |
  3. ' | Function.......: Product demo for FontLIB.                                |
  4. ' | Programmer(s)..: Kevin Spatz                                              |
  5. ' | Last Revision..: 04/14/88                                                 |
  6. ' +---------------------------------------------------------------------------+
  7.  
  8.  
  9. Define.environment:
  10.  
  11.      Option Base 0
  12.  
  13.      Rem $DYNAMIC
  14.      Dim FONT1%(255,18), FONT2%(255,18), FONT3%(255,18), St$(5)
  15.      Dim FONT4%(255,18), FONT5%(255,18), FONT6%(255,18)
  16.  
  17.      On ERROR goto Error.Handler
  18.  
  19.  
  20. Load.fonts:
  21.  
  22.      On ERROR goto Load.fonts.error
  23.  
  24.      Open "7X5.FNT" for input as #1: Close 1
  25.      Call Load.char.set( "7X5.FNT",   FONT1%() )
  26.  
  27.      Open "8X8.FNT" for input as #1: Close 1
  28.      Call Load.char.set( "8X8.FNT",   FONT2%() )
  29.  
  30.      Open "14X8.FNT" for input as #1: Close 1
  31.      Call Load.char.set( "14X8.FNT",  FONT3%() )
  32.  
  33.      Open "16X16.FNT" for input as #1: Close 1
  34.      Call Load.char.set( "16X16.FNT", FONT4%() )
  35.  
  36.      Open "8X16.FNT" for input as #1: Close 1
  37.      Call Load.char.set( "8X16.FNT",  FONT5%() )
  38.  
  39.      Open "16X8.FNT" for input as #1: Close 1
  40.      Call Load.char.set( "16X8.FNT",  FONT6%() )
  41.  
  42.      On ERROR goto Error.Handler
  43.      goto Initialize.program.variables
  44.  
  45.  
  46. Load.fonts.error:
  47.  
  48.      Print "All six .FNT files are reqired for this demo."
  49.      Print "                                             "
  50.      Print "     7X5.FNT     16X8.FNT     14X8.FNT       "
  51.      Print "     8X8.FNT     8X16.FNT     16X16.FNT      "
  52.      Print "                                             "
  53.      Resume QUIT
  54.  
  55.  
  56. Initialize.program.variables:
  57.  
  58.      St$(1)       = " "                     ' Error message return
  59.      St$(2)       = "3"                     ' COLOR
  60.      Dx           = 1
  61.      Dy           = 1
  62.  
  63.  
  64. Sense.diplay.type:
  65.  
  66.      Test.EGA:
  67.         On ERROR goto Test.CGA
  68.         scrn% = 9
  69.         Screen scrn%
  70.         Palette 0,0
  71.         Palette 1,12
  72.         Palette 2,9
  73.         Palette 3,63
  74.         On ERROR goto Error.Handler
  75.         Goto Page1
  76.      Test.CGA:
  77.         On ERROR goto No.graphics
  78.         scrn% = 2
  79.         Screen scrn%
  80.         On ERROR goto Error.Handler
  81.         Goto Page1
  82.      No.graphics:
  83.         Print "EGA or CGA adapter required for demo."
  84.         Goto QUIT
  85.  
  86.  
  87. Page1:             '( Intro screen defines the problem )
  88.  
  89.      cls
  90.      Print " "
  91.      Print " "
  92.      Print "QuickBASIC programmers, has this happened to you:     "
  93.      Print " "
  94.      Print "You have a problem!  You've used the LINE, CIRCLE, PAINT, COLOR, PSET, WINDOW,"
  95.      Print "VIEW and DRAW commands to assemble a clean, crisp, graphic display, and now's "
  96.      Print "the time to add the text.  But wait, can it be?  With all the flexibility you "
  97.      Print "had with the other commands, you would think that placing text on the screen  "
  98.      Print "at any desired location would be a snap.  Think again!                        "
  99.      Print " "
  100.      Print "Aside from the fact that you are limited to only one font (8x8 in CGA, 14x8 in"
  101.      Print "EGA), you are also forced to place your text at only the 25 row by 80 column  "
  102.      Print "positions that can be defined by a 'LOCATE row,column' command.               "
  103.      Print " "
  104.      Print "If you would be kind enough to hit any key, I will plot an imaginary graph to "
  105.      Print "illustrate this point.                                                        "
  106.      Print " "
  107.      Print " "
  108.      Print "  <<< Anywhere in the demo => Hit any key when ready for the next screen >>> "
  109.      Print " "
  110.      Gosub Wait.for.a.key
  111.  
  112.  
  113. Page2:             '( Display plot without fonts - point out problems )
  114.  
  115.      cls
  116.      Gosub Draw.graph
  117.      If scrn%=2 Then
  118.         Locate 01,29: Print "Sales - The Big Corporation"
  119.         Locate 23,15: Print " JAN FEB MAR  APR MAY JUN  JUL AUG SEP  OCT NOV DEC"
  120.         Locate 04,05: Print "$450,000"
  121.         Locate 06,05: Print "$400,000"
  122.         Locate 08,05: Print "$350,000"
  123.         Locate 10,05: Print "$300,000"
  124.         Locate 12,05: Print "$250,000"
  125.         Locate 14,05: Print "$200,000"
  126.         Locate 16,05: Print "$150,000"
  127.         Locate 18,05: Print "$100,000"
  128.         Locate 20,05: Print " $50,000"
  129.         Call FPrint( Font1%(),180., 40.,1.,1.,"THE TITLE DOESN'T STAND OUT",St$() )
  130.         Call FPrint( Font1%(),244., 50.,1.,1.,"AND",St$() )
  131.         Call FPrint( Font1%(),140., 60.,1.,1.,"THE AXIS LABELS CAN'T BE ALIGNED PROPERLY",St$() )
  132.      Else
  133.         Locate 01,29: Print "Sales - The Big Corporation"
  134.         Locate 23,15: Print " JAN FEB MAR  APR MAY JUN  JUL AUG SEP  OCT NOV DEC"
  135.         Locate 03,05: Print "$650,000"
  136.         Locate 06,05: Print "$550,000"
  137.         Locate 09,05: Print "$450,000"
  138.         Locate 12,05: Print "$350,000"
  139.         Locate 15,05: Print "$250,000"
  140.         Locate 18,05: Print "$150,000"
  141.         Locate 21,05: Print " $50,000"
  142.         Call FPrint( Font1%(),190., 50.,1.,1.," ( THE TITLE CERTAINLY FAILS TO STAND OUT. ) ",St$() )
  143.         Call FPrint( Font1%(),177.,270.,1.,1.," ( THE AXIS LABELS CAN'T BE ALIGNED PROPERLY. ) ",St$() )
  144.      End If
  145.      Gosub Wait.for.a.key
  146.  
  147.  
  148. Page3:             '( How about the IIS solution? )
  149.  
  150.      cls
  151.      Print " "
  152.      Print " "
  153.      Print "It wouldn't be fair of us to point this glaring problem out if we didn't have "
  154.      Print "a reasonable solution to offer you, right?  So, suppose I told you that I have"
  155.      Print "the means of allowing you to place any string of characters on any resolution "
  156.      Print "graphics screen with positional control down to the pixel.  In addition, each "
  157.      Print "string could be printed in any font size (from 2x2 all the way up to 16x16)   "
  158.      Print "and in any supported color.  And, so as not to box you in, each font file can "
  159.      Print "be edited if it is not to your liking, or new ones can be created.            "
  160.      Print " "
  161.      Print "If you would again hit any key, I will redisplay the previous imaginary graph,"
  162.      Print "using FontLIB routines to turn an OK graphic screen into an eye catcher. "
  163.      Print " "
  164.      Gosub Wait.for.a.key
  165.  
  166.  
  167. Page4:             '( Display enhanced plots - isn't it nice? )
  168.  
  169.      cls
  170.      Gosub Draw.graph
  171.  
  172.      If scrn%=2 Then
  173.  
  174.         Call FPrint( Font4%(), 108., 18.,1.,1.,"Sales - The Big Corporation",St$() )
  175.  
  176.         Call FPrint( Font2%(), 30., 35.,1.,1.,"$450,000",St$() )
  177.         Call FPrint( Font2%(), 30., 50.,1.,1.,"$400,000",St$() )
  178.         Call FPrint( Font2%(), 30., 65.,1.,1.,"$350,000",St$() )
  179.         Call FPrint( Font2%(), 30., 80.,1.,1.,"$300,000",St$() )
  180.         Call FPrint( Font2%(), 30., 95.,1.,1.,"$250,000",St$() )
  181.         Call FPrint( Font2%(), 30.,110.,1.,1.,"$200,000",St$() )
  182.         Call FPrint( Font2%(), 30.,125.,1.,1.,"$150,000",St$() )
  183.         Call FPrint( Font2%(), 30.,140.,1.,1.,"$100,000",St$() )
  184.         Call FPrint( Font2%(), 30.,155.,1.,1.," $50,000",St$() )
  185.  
  186.         Call FPrint( Font3%(),116.,180.,1.,1.,"Jan",St$() )
  187.         Call FPrint( Font3%(),151.,180.,1.,1.,"Feb",St$() )
  188.         Call FPrint( Font3%(),186.,180.,1.,1.,"Mar",St$() )
  189.         Call FPrint( Font3%(),221.,180.,1.,1.,"Apr",St$() )
  190.         Call FPrint( Font3%(),256.,180.,1.,1.,"May",St$() )
  191.         Call FPrint( Font3%(),291.,180.,1.,1.,"Jun",St$() )
  192.         Call FPrint( Font3%(),326.,180.,1.,1.,"Jul",St$() )
  193.         Call FPrint( Font3%(),361.,180.,1.,1.,"Aug",St$() )
  194.         Call FPrint( Font3%(),396.,180.,1.,1.,"Sep",St$() )
  195.         Call FPrint( Font3%(),431.,180.,1.,1.,"Oct",St$() )
  196.         Call FPrint( Font3%(),466.,180.,1.,1.,"Nov",St$() )
  197.         Call FPrint( Font3%(),501.,180.,1.,1.,"Dec",St$() )
  198.  
  199.         Call FPrint( Font1%(),185., 40.,1.,1.,"THE TITLE STANDS OUT NOW",St$() )
  200.         Call FPrint( Font1%(),244., 50.,1.,1.,"AND",St$() )
  201.         Call FPrint( Font1%(),150., 60.,1.,1.,"THE AXIS LABELS ARE ALIGNED PROPERLY",St$() )
  202.  
  203.      Else
  204.  
  205.         Call FPrint( Font4%(), 108., 22.,1.,1.,"Sales - The Big Corporation",St$() )
  206.  
  207.         Call FPrint( Font2%(), 30., 44.,1.,1.,"$650,000",St$() )
  208.         Call FPrint( Font2%(), 30., 64.,1.,1.,"$600,000",St$() )
  209.         Call FPrint( Font2%(), 30., 84.,1.,1.,"$550,000",St$() )
  210.         Call FPrint( Font2%(), 30.,104.,1.,1.,"$500,000",St$() )
  211.         Call FPrint( Font2%(), 30.,124.,1.,1.,"$450,000",St$() )
  212.         Call FPrint( Font2%(), 30.,144.,1.,1.,"$400,000",St$() )
  213.         Call FPrint( Font2%(), 30.,164.,1.,1.,"$350,000",St$() )
  214.         Call FPrint( Font2%(), 30.,184.,1.,1.,"$300,000",St$() )
  215.         Call FPrint( Font2%(), 30.,204.,1.,1.,"$250,000",St$() )
  216.         Call FPrint( Font2%(), 30.,224.,1.,1.,"$200,000",St$() )
  217.         Call FPrint( Font2%(), 30.,244.,1.,1.,"$150,000",St$() )
  218.         Call FPrint( Font2%(), 30.,264.,1.,1.,"$100,000",St$() )
  219.         Call FPrint( Font2%(), 30.,284.,1.,1.," $50,000",St$() )
  220.  
  221.         Call FPrint( Font3%(),116.,320.,1.,1.,"Jan",St$() )
  222.         Call FPrint( Font3%(),151.,320.,1.,1.,"Feb",St$() )
  223.         Call FPrint( Font3%(),186.,320.,1.,1.,"Mar",St$() )
  224.         Call FPrint( Font3%(),221.,320.,1.,1.,"Apr",St$() )
  225.         Call FPrint( Font3%(),256.,320.,1.,1.,"May",St$() )
  226.         Call FPrint( Font3%(),291.,320.,1.,1.,"Jun",St$() )
  227.         Call FPrint( Font3%(),326.,320.,1.,1.,"Jul",St$() )
  228.         Call FPrint( Font3%(),361.,320.,1.,1.,"Aug",St$() )
  229.         Call FPrint( Font3%(),396.,320.,1.,1.,"Sep",St$() )
  230.         Call FPrint( Font3%(),431.,320.,1.,1.,"Oct",St$() )
  231.         Call FPrint( Font3%(),466.,320.,1.,1.,"Nov",St$() )
  232.         Call FPrint( Font3%(),501.,320.,1.,1.,"Dec",St$() )
  233.  
  234.         Call FPrint( Font1%(),190., 50.,1.,1.," ( THE TITLE STANDS OUT NOW. ) ",St$() )
  235.         Call FPrint( Font1%(),177.,270.,1.,1.," ( ALL AXIS LABELS ARE ALIGNED PROPERLY. ) ",St$() )
  236.  
  237.      End If
  238.      Gosub Wait.for.a.key
  239.  
  240.  
  241. Page5:             '( Display enhanced plots - isn't it nice? )
  242.  
  243.      cls
  244.      Call FPrint( Font3%(), 20., 15.,1.,1.,"Why use the regular size font when you can also use:",St$() )
  245.      Call FPrint( Font1%(), 40., 40.,1.,1.,"A very small 7x5 size font,",St$() )
  246.      Call FPrint( Font2%(), 40., 60.,1.,1.,"or the EGA 43 line 8x8 size font,",St$() )
  247.      Call FPrint( Font3%(), 40., 80.,1.,1.,"or the standard 14x8 size font,",St$() )
  248.      Call FPrint( Font4%(), 40.,100.,1.,1.,"or the jumbo 16x16 size font,",St$() )
  249.      Call FPrint( Font5%(), 40.,120.,1.,1.,"or the double wide 8x16 size font,",St$() )
  250.      Call FPrint( Font6%(), 40.,140.,1.,1.,"or the double height 16x8 size font.",St$() )
  251.      Call FPrint( Font3%(), 20.,180.,1.,1.,"And if that's not enough, design your own!",St$() )
  252.      Gosub Wait.for.a.key
  253.  
  254.  
  255. Page6:             '( IIS - product and ordering info - misc. )
  256.  
  257.      Screen 0: Color 15
  258.      cls
  259.      Print "Maybe you're saying, 'Not bad, can I do that too?'  The answer, as you might  "
  260.      Print "have guessed is 'YES'.  And, (sigh of relief) very easily at that!            "
  261.      Print " "
  262.      Print "For the low price of $29.95, you get:                                         "
  263.      Print " "
  264.      Print "    ***   FontLIB       - The library file (Load, Save & Print fonts)         "
  265.      Print "    ***   FontEDIT      - The font editor                                     "
  266.      Print "    ***   Bit14x8       - 14x8 pixel character set                            "
  267.      Print "    ***   Bit8x8        - 8x8 pixel character set                             "
  268.      Print "    ***   Bit7x5        - 7x5 pixel character set                             "
  269.      Print "    ***   Bit16x16      - 16x16 pixel character set                           "
  270.      Print "    ***   Bit16x8       - 16x8 pixel character set                           "
  271.      Print "    ***   Bit8x16       - 8x16 pixel character set                           "
  272.      Print "    ***   Instructions  - Yes, we even tell you how to use it!                "
  273.      Print " "
  274.      Print "                 Intelligent Industrial Systems, Inc.                         "
  275.      Print "                        333 Meadowland Parkway                                "
  276.      Print "                      Secaucus, New Jersey 07094                              "
  277.      Print "                            (201) 319-1200                                    "
  278.      Print " "
  279.      Print "If you want your graphic screens to look the best they can, you owe it to     "
  280.      Print "yourself to investigate FontLIB.   ";
  281.  
  282.      Goto QUIT
  283.  
  284.  
  285. Draw.graph:
  286.  
  287.      If scrn% = 2 Then
  288.         Line (100, 19)-(540,166),,B
  289.         Line (116,100)-(140,166),,BF
  290.         Line (151,110)-(175,166),,BF
  291.         Line (186,115)-(210,166),,BF
  292.         Line (221,155)-(245,166),,BF
  293.         Line (256,160)-(280,166),,BF
  294.         Line (291,140)-(315,166),,BF
  295.         Line (326,130)-(350,166),,BF
  296.         Line (361,110)-(385,166),,BF
  297.         Line (396, 80)-(420,166),,BF
  298.         Line (431, 50)-(455,166),,BF
  299.         Line (466, 45)-(490,166),,BF
  300.         Line (501, 30)-(525,166),,BF
  301.         For I=166 to 19 step -15
  302.            Line (100,I)-(105,I)
  303.         Next I
  304.         Line (100,166)-(540,166)
  305.      Else
  306.         Line (100, 30)-(540,300), 3, B
  307.         Line (116,100)-(139,300), 1, BF
  308.         Line (151,110)-(174,300), 2, BF
  309.         Line (186,115)-(209,300), 1, BF
  310.         Line (221,170)-(244,300), 2, BF
  311.         Line (256,200)-(279,300), 1, BF
  312.         Line (291,180)-(314,300), 2, BF
  313.         Line (326,160)-(349,300), 1, BF
  314.         Line (361,150)-(384,300), 2, BF
  315.         Line (396, 90)-(419,300), 1, BF
  316.         Line (431, 80)-(454,300), 2, BF
  317.         Line (466, 75)-(489,300), 1, BF
  318.         Line (501, 50)-(524,300), 2, BF
  319.         Line (116,100)-(151,110), 3
  320.         Line (151,110)-(186,115), 3
  321.         Line (186,115)-(221,170), 3
  322.         Line (221,170)-(256,200), 3
  323.         Line (256,200)-(291,180), 3
  324.         Line (291,180)-(326,160), 3
  325.         Line (326,160)-(361,150), 3
  326.         Line (361,150)-(396, 90), 3
  327.         Line (396, 90)-(431, 80), 3
  328.         Line (431, 80)-(466, 75), 3
  329.         Line (466, 75)-(501, 50), 3
  330.         For I=300 to 30 step -20
  331.            Line (100,I)-(105,I), 3
  332.         Next I
  333.         Line (100,300)-(540,300), 3, B
  334.      End If
  335.      Return
  336.  
  337.  
  338. Wait.for.a.key:
  339.  
  340.      aa$ = INKEY$
  341.      If aa$ = "" goto Wait.for.a.key
  342.      Return
  343.  
  344.  
  345. Error.Handler:
  346.  
  347.       On ERROR goto 0
  348.  
  349.  
  350. QUIT:
  351.  
  352.      End
  353.  
  354.  
  355. ' +---------------------------------------------------------------------------+
  356. ' |  End Module                                                               |
  357. ' +---------------------------------------------------------------------------+
  358.